class Class {
    constructor(number){
        this.number=number;
    }
    getDisplayName(){
        let result =`Class ${this.number}`;
        return result;
    }
    assignLeader(student){
        if(student.klass.number==this.number)
            {
                this.leader=student;
                if(this.teacher!=undefined)
                console.log(`I am ${this.teacher.name}. I know ${student.name} become Leader of Class ${student.klass.number}.`)
            }
        else
            console.log("It is not one of us.");
    }
    appendMember(student){
        student.klass=this;
        if(this.teacher!=undefined)
        console.log(`I am ${this.teacher.name}. I know ${student.name} has joined Class ${student.klass.number}.`)
    }
    registerAssignLeaderListener(teacher){
        this.teacher=teacher;
    }
    registerJoinListener(teacher){
        this.teacher=teacher;
    }
}
export default Class;


